<?php

/**
 * methodes pour recuperer les donations 
 *
 * @author iLyas
 */
class Donations_model extends CI_Model{
    
    function get_donations_for_this_page($page_id){
        $this->db->where('donation_page_id', $page_id);
        $q = $this->db->get('donation');
        
        if($q->num_rows() > 0)
                $data = $q->result();
        
        return $data;
    }
    
    function get_donations_for_this_user($user_id){
        $this->db->where('donation_user_id', $user_id);
        $q = $this->db->get('donation');
        
        if($q->num_rows() > 0)
                $data = $q->result();

        return $data;
    }
    
}

?>
